$(function () {
    window.$containerObj = {
        main: $('#container'),  // container元素
        data: {}, // hospital、type、assets、year数据
        init: function () {
            // 初始化类型参数为0，下拉框为年限指数
            this.brandTag = '0';
            this.totalObj.init(); // 初始化 概览框 对象
            this.chartObj.init(); // 初始化 echart 对象
            this.top5Obj.init(); // 初始化 echart 对象
            this.modalObj.init(); // 初始化 详情模态框 对象
        },
        /* 查询hospital、type、assets、year数据 */
        queryData: function (tag, params, fn) { // tag: hospital、type、assets、year, params: 筛选条件, fn: 回调函数
            var $this = this;
            var url = basePath + 'charts/area/' + (this.brandTag === '1' ? 'maintain' : 'brand') + '/' + tag;
            publicAjax(url, 'post', $.extend({}, $headerObj.searchObj.params, params || {}, {maintainTag: 2}), function (data) {
                $this.data[tag] = data.data && data.data.list ? data.data : {list: []};  // 设置$containerObj对象data数据
                $this.data[tag].list.calTotal();  // 计算总数，按照curPrice排序
                // 设置模态框数据
                $this.modalObj.data[tag] = $.extend(true, {}, $this.data[tag]);
                if (fn) {fn();} else {
                    if (tag === 'hospital') {  // 设置echart图表数据
                        $this.chartObj.convertData(); // chartObj转换echart所用数据
                        $this.chartObj.setChart();  // chartObj设置echart图表
                    }
                    // 获取数据长度，用于计算TOP5显示条数
                    var length = tag === 'type'
                        ? $this.data[tag].list[-1].list ? $this.data[tag].list[-1].list.length : 0
                        : $this.data[tag].list.length;
                    $this.top5Obj.convertData(tag, 0, length > 5 ? 5 : length); // top5Obj转化数据，及设置TOP5列表
                    /* 如果模态框显示则刷新模态框数据 */
                    if ($this.modalObj.main.is(':visible') || $this.modalObj.yearMain.is(':visible')) {
                        $this.modalObj.setModal($this.modalObj.main.data().tag, 'curPrice', 'desc');
                    }
                }
            }, true);
        },
        /* 点击TOP5列表及详情模态框跳转关系 */
        query: function (tag, id) {
            var $this = this;
            if (tag === 'hospital') { // 如果是医院就跳转到医院报表
                window.open(basePath + 'charts/hospital/department-brand/page?hospitalId=' + id);
            } else if (tag === 'type') {  // 如果是设备类型，设置设备类型参数，并跳转到设备型号页面
                location.href = basePath + 'charts/area/allocation/model-page?typeId=' + id;
            } else if (tag === 'model') {  // 如果是设备型号，显示该型号下所有设备
                this.modalObj.queryAssetsTable('assets', {modelName: id});
                this.modalObj.assetsMain.iziModal('setTitle', '设备详情');
            } else if (tag === 'assets') {  // 如果是具体设备就跳转到设备详情页面
                window.open(basePath + 'charts/overview/assets/page?deviceId=' + id);
            } else if (tag === 'year') {  // 如果是月份显示，筛选年份数据
                this.queryData('hospital', {year: id}, function () {
                    $this.modalObj.setModal('hospital', '', 'desc', ',year:' + id);
                });
            }
        }
    };
    /* 概览框对象 */
    $containerObj.totalObj = {
        main: $containerObj.main.find('.main-total'), // 概览框元素
        data: {}, // 概览框数据
        init: function () {
            this.queryData(); // 查询概览框数据
            this.bindEvent();
        },
        /* 查询概览框数据 flag：点击气泡时，传true，只查询除气泡图以外的数据 */
        queryData: function (flag) {
            var $this = this;
            if (flag) { // flag：点击气泡时，传true，只查询除气泡图以外的数据
                if (this.brandTag === '1') dealMaintainSlow();
                $containerObj.queryData('type');
                $containerObj.queryData('model');
                $containerObj.queryData('assets');
            } else {
                publicAjax(basePath + 'charts/area/brand/overview', 'post', $headerObj.searchObj.params, function (data) {
                    $this.data = data.data;
                    $this.setData();  // 设置数据
                }, true);
                if (this.brandTag === '1') dealMaintainSlow();
                $containerObj.queryData('hospital');
                $containerObj.queryData('type');
                $containerObj.queryData('model');
                $containerObj.queryData('assets');
                // 触发 月份显示、全部数据 下拉框，使页面显示全部数据
                $containerObj.chartObj.changeSelect.val(0).trigger('change');
            }
        },
        /* 设置概览框数据 */
        setData: function () {
            var data = this.data;
            this.main.find('#total-value-1-1').html(fix0(data.allAssets.curCounts)); // 设备数量
            this.main.find('#total-value-1-2').text(Math.abs(fix2(data.allAssets.deviceCountsYoy)) + '%')  // 同比
                .next().find('img').attr('src', data.allAssets.deviceCountsYoy < 0
                ? basePath + 'plugins/charts/images/arrow_up.png'
                : basePath + 'plugins/charts/images/arrow_down.png'
            );
            this.main.find('#total-value-1-3').html(fix0(data.allAssets.hospitalCounts)); // 医院数量
            this.main.find('#total-value-1-4').html(fix0(data.allAssets.typeCounts)); // 设备类型数量
            this.main.find('#total-value-1-5').html(fix2(data.allAssets.curPrice / PRICE_CONVERT)); // 设备金额
            this.main.find('#total-value-1-6').text(Math.abs(fix2(data.allAssets.devicePriceYoy)) + '%')  // 同比
                .next().find('img').attr('src', data.allAssets.devicePriceYoy < 0
                ? basePath + 'plugins/charts/images/arrow_down.png'
                : basePath + 'plugins/charts/images/arrow_up.png'
            );
            // >300万
            this.main.find('#total-value-2-1').html(fix0(data.amountList[0].curCounts)); // 设备数量
            this.main.find('#total-value-2-2').text(Math.abs(fix2(data.amountList[0].deviceCountsYoy)) + '%')  // 同比
                .next().find('img').attr('src', data.amountList[0].deviceCountsYoy < 0
                ? basePath + 'plugins/charts/images/arrow_up.png'
                : basePath + 'plugins/charts/images/arrow_down.png'
            );
            this.main.find('#total-value-2-3').html(fix0(data.amountList[0].hospitalCounts)); // 医院数量
            this.main.find('#total-value-2-4').html(fix0(data.amountList[0].typeCounts)); // 设备类型数量
            this.main.find('#total-value-2-5').html(fix2(data.amountList[0].curPrice / PRICE_CONVERT)); // 设备金额
            this.main.find('#total-value-2-6').text(Math.abs(fix2(data.amountList[0].devicePriceYoy)) + '%')  // 同比
                .next().find('img').attr('src', data.amountList[0].devicePriceYoy < 0
                ? basePath + 'plugins/charts/images/arrow_down.png'
                : basePath + 'plugins/charts/images/arrow_up.png'
            );
            // 100-300万
            this.main.find('#total-value-3-1').html(fix0(data.amountList[1].curCounts)); // 设备数量
            this.main.find('#total-value-3-2').text(Math.abs(fix2(data.amountList[1].deviceCountsYoy)) + '%')  // 同比
                .next().find('img').attr('src', data.amountList[1].deviceCountsYoy < 0
                ? basePath + 'plugins/charts/images/arrow_up.png'
                : basePath + 'plugins/charts/images/arrow_down.png'
            );
            this.main.find('#total-value-3-3').html(fix0(data.amountList[1].hospitalCounts)); // 医院数量
            this.main.find('#total-value-3-4').html(fix0(data.amountList[1].typeCounts)); // 设备类型数量
            this.main.find('#total-value-3-5').html(fix2(data.amountList[1].curPrice / PRICE_CONVERT)); // 设备金额
            this.main.find('#total-value-3-6').text(Math.abs(fix2(data.amountList[1].devicePriceYoy)) + '%')  // 同比
                .next().find('img').attr('src', data.amountList[1].devicePriceYoy < 0
                ? basePath + 'plugins/charts/images/arrow_down.png'
                : basePath + 'plugins/charts/images/arrow_up.png'
            );
            // 维修情况
            this.main.find('#total-value-4-1').html(fix2(data.maintainInfo.curOnceRepairRate)); // 一次修复率
            var time = min2bigger(data.maintainInfo.curAvgRepairUsedMin);
            this.main.find('#total-value-4-2').html(time.value) // 平均维修时间
                .next('.unit').html(time.unit);
            this.main.find('#total-value-4-3').html(fix0(data.maintainInfo.curToRepairCounts)); // 维修次数
            this.main.find('#total-value-4-4').text(Math.abs(fix2(data.maintainInfo.toRepairCountsYoy)) + '%')  // 同比
                .next().find('img').attr('src', data.maintainInfo.toRepairCountsYoy < 0
                ? basePath + 'plugins/charts/images/arrow_down.png'
                : basePath + 'plugins/charts/images/arrow_up.png'
            );
            this.main.find('#total-value-4-5').html(fix2(data.maintainInfo.curEstimateTotalCost / PRICE_CONVERT)); // 维修金额
        },
        bindEvent: function () {
            // 设置标题收支比范围
            var totalTitle = this.main.find('.total-title');
            totalTitle.off().on('click', function () {
                if ($(this).index('.total-title') >= 3) return;
                $headerObj.searchObj.params.priceStart = $(this).data().priceStart ? $(this).data().priceStart * PRICE_CONVERT : $(this).data().priceStart;
                $headerObj.searchObj.params.priceEnd = $(this).data().priceEnd ? $(this).data().priceEnd * PRICE_CONVERT : $(this).data().priceEnd;
                $headerObj.searchObj.setParamsToForm($headerObj.searchObj.params);
                totalTitle.removeClass('active');
                $(this).addClass('active');
                loading(function () {
                    $containerObj.queryData('hospital');
                    $containerObj.queryData('type');
                    $containerObj.queryData('model');
                    $containerObj.queryData('assets');
                });
            });
        }
    };
    /* echart对象 */
    $containerObj.chartObj = {
        main: $containerObj.main.find('.main-chart'), // echarts图表模块主元素
        changeSelect: $('#chart-change'), // 月份显示/全部数据 下拉框
        typeChangeSelect: $('#type-change'),  // 切换显示类型
        data: { // echarts图表数据
            seriesData: [],
            xAxis: [],
            sizeMin: 0,
            sizeMax: 0,
            sizeRange: 0
        },
        yearData: { // 月份显示
            seriesData: [],
            xAxis: []
        },
        init: function () {
            this.initSelect();
            this.initChart(); // 初始化echats图表
            this.bindEvent(); // 绑定事件
        },
        /* 初始化下拉框 */
        initSelect: function () {
            this.typeChangeSelect.select2({
                minimumResultsForSearch: -1,
                width: 1.8 * rem
            });
        },
        /* 初始化echarts图表 */
        initChart: function () {
            this.chart = echarts.init(this.main.find('#chart')[0]);
            this.chart.on('click', this.click.bind(this));  // echarts绑定click事件
        },
        /* echarts图表click事件，点击气泡，top5高亮，筛选其他数据 */
        click: function (params) {
            var $this = this;
            if ((params.componentType !== 'markLine') && ($this.changeSelect.val() !== '1')) { // 点击的不是平均线及月份显示不显示
                loading(function () {
                    var index = -1, // 点击气泡图的index
                        id = params.data[6] || $containerObj.data.hospital.list.getIdByName(params.name),
                        length = $containerObj.data.hospital.list.length; // 医院列表的长度
                    var selectHospital = $('.select_hospital'); // hospital筛选框
                    /* 点击的气泡已经筛选了，就取消高亮，没筛选就加上高亮 */
                    if ((selectHospital.val() || []).join(',') === [id].join(',')) {
                        selectHospital.val('').trigger('change');
                        $headerObj.searchObj.params.hospitalId = '';
                        $containerObj.totalObj.queryData(true);
                        index = -1;
                    } else {
                        selectHospital.val(id).trigger('change');
                        $headerObj.searchObj.params.hospitalId = JSON.stringify([id]);
                        $containerObj.totalObj.queryData(true);
                        index = $containerObj.data.hospital.list.getIndexByKey('id', id);
                    }
                    if (params.seriesType === 'line') {
                        var seriesIndex = params.seriesIndex,
                            optionB = $this.optionB;
                        if ($this.copySatus) {
                            $this.optionBTemp = $.extend(true, {}, optionB);
                            $this.optionBTempTemp = $.extend(true, {}, optionB);
                        } else {
                            $this.optionBTemp = {};
                            $this.optionBTemp = $.extend(true, {}, $this.optionBTempTemp);
                        }
                        $this.copySatus = false;
                        if ($this.optionBTemp.series[seriesIndex].type === 'bar') {
                            $this.optionBTemp.series[seriesIndex].itemStyle.normal.opacity = 1;
                        } else if ($this.optionBTemp.series[seriesIndex].type === 'line') {
                            $this.optionBTemp.series[seriesIndex].lineStyle.normal.width = 4;
                            $this.optionBTemp.series[seriesIndex].z = 10;
                        }
                        $this.chart.setOption($this.optionBTemp);
                    }
                    /* 设置top5数据 */
                    if (length > 5) {
                        if (index > length - 3) {
                            $containerObj.top5Obj.convertData('hospital', length - 5, length, index);
                        }
                        if (index < 2) {
                            $containerObj.top5Obj.convertData('hospital', 0, length > 5 ? 5 : length, index);
                        } else {
                            $containerObj.top5Obj.convertData('hospital', index - 2, index + 3, index);
                        }
                    } else {
                        $containerObj.top5Obj.convertData('hospital', 0, length, index);
                    }
                });
            }
        },
        /* 转换echarts数据 */
        convertData: function () {
            var data = $containerObj.data.hospital;
            if ($containerObj.brandTag === '0') {
                this.data.seriesData = [];
                var curCounts = [];
                for (var i = 0; i < data.list.length; i++) {
                    this.data.seriesData.push([
                        fixLine(data.list[i].curPrice / PRICE_CONVERT),
                        fixLine(data.list[i].curAgeLimitMeasure),
                        fixLine(data.list[i].curCounts),
                        fixStr(data.list[i].name),
                        fixLine(data.list[i].devicePriceYoy),
                        fixLine(data.list[i].deviceCountsYoy),
                        data.list[i].id
                    ]);
                    curCounts.push(data.list[i].curCounts);
                }
                this.data.sizeMin = curCounts.min();
                this.data.sizeMax = curCounts.max();
                this.data.sizeRange = this.data.sizeMax - this.data.sizeMin;
                this.data.avgPrice = fix2(data.avgPrice / PRICE_CONVERT);
                this.data.curAgeLimitMeasure = 1;
            } else if ($containerObj.brandTag === '1') {
                this.data.seriesData = [[], [], [], [], [], [], []];
                this.data.xAxis = [];
                for (var i = 0; i < data.list.length; i++) {
                    this.data.seriesData[0].push(fixLine(data.list[i].curBigRepairCounts));
                    this.data.seriesData[1].push(fixLine(data.list[i].curMiddleRepairCounts));
                    this.data.seriesData[2].push(fixLine(data.list[i].curSmallRepairCounts));
                    this.data.seriesData[3].push(fixLine(data.list[i].curFaultCounts));
                    this.data.seriesData[4].push(fixLine(data.list[i].curIntactRatio));
                    this.data.seriesData[5].push(fixLine(data.list[i].curOnceRepairRate));
                    this.data.seriesData[6].push(fixLine(data.list[i].curUpkeepRate));
                    this.data.xAxis.push(fixStr(data.list[i].name));
                }
            }
        },
        /* 设置echarts图表 */
        setChart: function () {
            if ($containerObj.brandTag === '0') {
                this.optionChart.series[0].data = this.data.seriesData;
                this.optionChart.series[0].markLine.data[0].xAxis = this.data.avgPrice;
                this.optionChart.series[0].markLine.data[1].yAxis = this.data.curAgeLimitMeasure;
                this.chart.clear();
                this.chart.setOption(this.optionChart);
            } else if ($containerObj.brandTag === '1') {
                for (var i = 0; i < this.data.seriesData.length; i++) {
                    this.optionB.series[i].data = this.data.seriesData[i];
                }
                this.optionB.xAxis.data = this.data.xAxis;

                this.chart.clear();
                this.chart.setOption(this.optionB);
            }
            this.copySatus = true;
        },
        /* 查询月份显示 */
        queryYearData: function () {
            var $this = this;
            publicAjax(basePath + 'charts/area/brand/year-trend', 'post', $headerObj.searchObj.params, function (data) {
                $containerObj.data.year = data.data;
                $containerObj.data.year.list.calTotal();
                $this.convertYearData();
                $this.setYearChart();
                $containerObj.top5Obj.convertData('year', 0, data.data.list.length);
                // 设置模态框数据
                $containerObj.modalObj.data.year = $.extend(true, {}, $containerObj.data.year);
                loading(true);
            }, true);
        },
        /* 转换月份显示 */
        convertYearData: function () {
            var data = $containerObj.data.year;
            this.yearData.xAxis = [];
            this.yearData.seriesData = [[], []];
            for (var i = 0; i < data.list.length; i++) {
                this.yearData.xAxis.push(data.list[i].name);
                this.yearData.seriesData[0].push(data.list[i].curPrice / PRICE_CONVERT);
                this.yearData.seriesData[1].push(data.list[i].curCounts);
            }
        },
        /* 设置月份显示echarts图表 */
        setYearChart: function () {
            this.optionYear.xAxis.data = this.yearData.xAxis;
            for (var i = 0; i < this.yearData.seriesData.length; i++) {
                this.optionYear.series[i].data = this.yearData.seriesData[i];
            }

            this.chart.clear();
            this.chart.setOption(this.optionYear);
        },
        /* 绑定事件 */
        bindEvent: function () {
            var $this = this;
            var yearBtn = this.main.find('.year-btn'),
                chartTitle = this.main.find('.chart-title');
            yearBtn.on('click', function () {
                var value = 1 - parseInt($this.changeSelect.val());
                $this.changeSelect.val(value).trigger('change');
            });
            /* 月份显示/全部显示 下拉框change事件 */
            this.changeSelect.on('change', function () {
                var value = parseInt($(this).val());
                if (value) {
                    loading();
                    yearBtn.addClass('active').find('span').html($.i18n.prop('charts.button.qbxs'));
                    chartTitle.html($.i18n.prop('charts.button.lnsj')).data().tag = 'year';
                    $this.main.find('.quadrantContainner').hide();
                    $this.typeChangeSelect.next('.select2').hide();
                    $containerObj.top5Obj.changeShow(value);
                    $this.queryYearData();
                } else {
                    yearBtn.removeClass('active').find('span').html($.i18n.prop('charts.button.lnsj'));
                    chartTitle.html($.i18n.prop('charts.title.yljgfb')).data().tag = 'hospital';
                    $this.chart.clear();
                    if ($containerObj.brandTag >= 1) {
                        $this.main.find('.quadrantContainner').hide();
                        $this.chart.setOption($this.optionB);
                    } else {
                        $this.main.find('.quadrantContainner').show();
                        $this.chart.setOption($this.optionChart);
                    }
                    $this.typeChangeSelect.next('.select2').show();
                    $containerObj.top5Obj.changeShow(value);
                }
            });

            /* type切换 */
            this.typeChangeSelect.on('change', function () {
                var obj = $(this);
                loading(function () {
                    var value = obj.val();
                    $containerObj.brandTag = value;
                    $containerObj.queryData('hospital');
                    $containerObj.queryData('type');
                    $containerObj.queryData('model');
                    $containerObj.queryData('assets');

                    if (value >= 1) {
                        $this.main.find('.quadrantContainner').hide();
                    } else {
                        $this.main.find('.quadrantContainner').show();
                    }
                });
            });

            /* 处理象限点击 */
            var currentOptionTemp,
                optionAgelimit = this.optionChart;
            this.main.find('.quadrant').on('click', function () {
                var index = $(this).index();
                var arr = optionAgelimit.series[0].data;
                var markLimeArr = optionAgelimit.series[0].markLine.data;
                var arrTemp = [];
                currentOptionTemp = optionAgelimit;
                if ($(this).hasClass('active')) {
                    $(this).removeClass('active');
                    arrTemp = arr;
                    currentOptionTemp.series[0].markLine.data = markLimeArr;
                } else if (index === 1) {
                    $(this).addClass('active').siblings().removeClass('active');
                    for (var i = 0; i < arr.length; i++) {
                        if ((parseFloat(arr[i][0]) >= parseFloat(markLimeArr[0].xAxis)) && (parseFloat(arr[i][1]) >= parseFloat(markLimeArr[1].yAxis))) {
                            arrTemp.push(arr[i]);
                        } else {
                            arrTemp.push([0, 0, 0, i])
                        }
                    }
                    currentOptionTemp.series[0].markLine.data = [];
                } else if (index === 2) {
                    $(this).addClass('active').siblings().removeClass('active');
                    for (var i = 0; i < arr.length; i++) {
                        if ((parseFloat(arr[i][0]) < parseFloat(markLimeArr[0].xAxis)) && (parseFloat(arr[i][1]) >= parseFloat(markLimeArr[1].yAxis))) {
                            arrTemp.push(arr[i]);
                        } else {
                            arrTemp.push([0, 0, 0, i])
                        }
                    }
                    currentOptionTemp.series[0].markLine.data = [];
                } else if (index === 3) {
                    $(this).addClass('active').siblings().removeClass('active');
                    for (var i = 0; i < arr.length; i++) {
                        if ((parseFloat(arr[i][0]) < parseFloat(markLimeArr[0].xAxis)) && (parseFloat(arr[i][1]) < parseFloat(markLimeArr[1].yAxis))) {
                            arrTemp.push(arr[i]);
                        } else {
                            arrTemp.push([0, 0, 0, i])
                        }
                    }
                    currentOptionTemp.series[0].markLine.data = [];
                } else if (index === 4) {
                    $(this).addClass('active').siblings().removeClass('active');
                    for (var i = 0; i < arr.length; i++) {
                        if ((parseFloat(arr[i][0]) >= parseFloat(markLimeArr[0].xAxis)) && (parseFloat(arr[i][1]) < parseFloat(markLimeArr[1].yAxis))) {
                            arrTemp.push(arr[i]);
                        } else {
                            arrTemp.push([0, 0, 0, i])
                        }
                    }
                    currentOptionTemp.series[0].markLine.data = [];
                }
                currentOptionTemp.series[0].data = arrTemp;
                $this.chart.clear();
                $this.chart.setOption(currentOptionTemp);
                optionAgelimit.series[0].data = arr;
                optionAgelimit.series[0].markLine.data = markLimeArr;
            });
        },
        optionChart: {
            color: ['#31860f'],
            backgroundColor: '#373945',
            tooltip: {
                trigger: 'item',
                textStyle: {
                    fontSize: 0.28 * rem
                },
                formatter: function (a) {
                    if (a.componentType === 'markLine') {
                        return a.name + ':' + a.value;
                    } else {
                        return a.data[3] + '<br/>'
                            + $.i18n.prop('share.overview.sbje') + '：' + fix2(a.data[0]) + $.i18n.prop('share.unit.wanyuan') + '<br/>'
                            + $.i18n.prop('share.overview.sbsl') + '：' + fix0(a.data[2]) + $.i18n.prop('share.unit.tai') + '<br/>'
                            + $.i18n.prop('charts.index.sbjetb') + '：' + fix2(a.data[4]) + '%<br/>'
                            + $.i18n.prop('charts.index.sbsltb') + '：' + fix2(a.data[5]) + '%<br/>'
                            + $.i18n.prop('share.assets.nxzs') + '：' + fix2(a.data[1]);
                    }
                }
            },
            dataZoom: [{
                type: 'inside',
                xAxisIndex: [0],
                start: 0,
                end: 100
            },
                {
                    type: 'inside',
                    yAxisIndex: [0],
                    start: 0,
                    end: 100
                }
            ],
            grid: {
                top: 1.6 * rem,
                left: rem * 0.4,
                right: 2.4 * rem,
                bottom: 0,
                containLabel: true
            },
            xAxis: {
                name: $.i18n.prop('charts.axis.sbje-wy'),
                type: 'value',
                nameTextStyle: {
                    color: '#fff',
                    fontSize: 0.28 * rem
                },
                axisLabel: {
                    show: true,
                    fontSize: parseInt(0.28 * rem),
                    textStyle: {
                        color: '#fff'
                    }
                },
                splitLine: {
                    show: false,
                    lineStyle: {
                        color: '#f00',
                        type: 'dashed'
                    }
                },
                axisLine: {
                    lineStyle: {
                        color: '#fff'
                    }
                },
                axisTick: {
                    lineStyle: {
                        color: '#fff'
                    }
                }
            },
            yAxis: [{
                name: $.i18n.prop('charts.select.nxzs'),
                type: 'value',
                nameTextStyle: {
                    color: '#fff',
                    fontSize: 0.28 * rem
                },
                axisLabel: {
                    show: true,
                    fontSize: 0.28 * rem,
                    textStyle: {
                        color: '#fff'
                    }
                },
                splitLine: {
                    show: false,
                    lineStyle: {
                        color: '#f00',
                        type: 'dashed'
                    }
                },
                axisLine: {
                    lineStyle: {
                        color: '#fff'
                    }
                },
                axisTick: {
                    lineStyle: {
                        color: '#fff'
                    }
                }
            }],
            series: [{
                type: 'scatter',
                data: [],
                symbolSize: function (data) {
                    if (data[2] === 0) return 0;
                    if ($containerObj.chartObj.data.sizeRange == 0) return 35;
                    return data[2] === 0 ? 0 : (30 * (data[2] - $containerObj.chartObj.data.sizeMin) / $containerObj.chartObj.data.sizeRange + 20);
                },
                markLine: {
                    lineStyle: {
                        normal: {
                            color: MARKLINE_COLOR,
                            type: 'dashed',
                            opacity: 0.4
                        }
                    },
                    data: [
                        {type: 'average', name: $.i18n.prop('charts.avg.sbjepjz(wy)'), valueIndex: 0, xAxis: null},
                        {type: 'average', name: $.i18n.prop('charts.avg.nxzsbzx'), valueIndex: 1, yAxis: null}
                    ]
                }
            }]
        },
        optionB: {
            color: ['#2089ff', '#6c63ff', '#12a0df', '#fb8a22', '#fef534'],
            backgroundColor: '#373945',
            tooltip: {
                trigger: 'axis',
                axisPointer: {type: 'shadow'},
                textStyle: {fontSize: 0.28 * rem},
                formatter: function (a) {
                    if (a.componentType == "markLine") {
                        return a.name + ':' + a.value;
                    } else {
                        var str = a[0].name + '<br/>';
                        var value = null;
                        for (var i = 0; i < a.length; i++) {
                            value = a[i].seriesId.split('-')[0] === $.i18n.prop('share.unit.ci') ? fix0(a[i].value) : fix2(a[i].value);
                            str += a[i].seriesName + '：' + value + a[i].seriesId.split('-')[0] + '<br/>';
                        }
                        return str;
                    }
                }
            },
            legend: {
                x: "right", top: 0.4 * rem, left: 8 * rem,
                textStyle: {color: '#AAA', fontSize: 0.28 * rem},
                data: [$.i18n.prop('maintain.overview.dwx'), $.i18n.prop('maintain.overview.zwx'), $.i18n.prop('maintain.overview.xwx'), $.i18n.prop('maintain.overview.blsj'), $.i18n.prop('maintain.charts.whl'), $.i18n.prop('maintainer.overview.ycxfl'), $.i18n.prop('maintain.charts.byl')]
            },
            dataZoom: [{type: 'inside', xAxisIndex: [0], start: 0, end: 100}],
            grid: {top: 1.6 * rem, left: 0.4 * rem, right: 0.4 * rem, bottom: 0, containLabel: true},
            xAxis: {
                type: 'category', data: [],
                axisLabel: {rotate: 30, fontWeight: 100, fontSize: 0.24 * rem, textStyle: {color: '#fff'}},
                nameTextStyle: {color: '#fff', fontSize: 0.28 * rem},
                splitLine: {show: false, lineStyle: {color: '#f00', type: 'dashed'}},
                axisLine: {lineStyle: {color: '#fff'}},
                axisTick: {lineStyle: {color: '#fff'}}
            },
            yAxis: [{
                name: $.i18n.prop('share.unit.ci'), type: 'value',
                splitLine: {lineStyle: {type: 'dashed'}},
                axisLabel: {fontSize: 0.28 * rem, textStyle: {color: '#fff'}},
                nameTextStyle: {color: '#fff', fontSize: 0.28 * rem},
                axisLine: {lineStyle: {color: '#fff'}},
                axisTick: {lineStyle: {color: '#fff'}}
            }, {
                name: '%', type: 'value',
                splitLine: {show: false, lineStyle: {type: 'dashed'}},
                axisLabel: {fontSize: 0.28 * rem, textStyle: {color: '#fff'}},
                nameTextStyle: {color: '#fff', fontSize: 0.28 * rem},
                axisLine: {lineStyle: {color: '#fff'}},
                axisTick: {lineStyle: {color: '#fff'}}
            }],
            series: [{id: $.i18n.prop('share.unit.ci') + '-1', name: $.i18n.prop('maintain.overview.dwx'), type: 'bar', barMaxWidth: 0.8 * rem, stack: 'one', data: []},
                {id: $.i18n.prop('share.unit.ci') + '-2', name: $.i18n.prop('maintain.overview.zwx'), type: 'bar', barMaxWidth: 0.8 * rem, stack: 'one', data: []},
                {id: $.i18n.prop('share.unit.ci') + '-3', name: $.i18n.prop('maintain.overview.xwx'), type: 'bar', barMaxWidth: 0.8 * rem, stack: 'one', data: []},
                {id: $.i18n.prop('share.unit.ci') + '-4', name: $.i18n.prop('maintain.overview.blsj'), type: 'bar', barMaxWidth: 0.8 * rem, barGap: '0%', data: []},
                {id: '%-4', name: $.i18n.prop('maintain.charts.whl'), type: 'line', yAxisIndex: 1, data: [], lineStyle: {normal: {width: 2}}},
                {id: '%-5', name: $.i18n.prop('maintainer.overview.ycxfl'), type: 'line', yAxisIndex: 1, data: [], lineStyle: {normal: {width: 2}}},
                {id: '%-6', name: $.i18n.prop('maintain.charts.byl'), type: 'line', yAxisIndex: 1, data: [], lineStyle: {normal: {width: 2}}}]
        },
        optionYear: {
            color: ['#2089ff', '#6c63ff'],
            backgroundColor: '#373945',
            tooltip: {
                trigger: 'axis',
                axisPointer: {type: 'shadow'},
                textStyle: {fontSize: 0.28 * rem},
                formatter: function (a) {
                    if (a.componentType == "markLine") {
                        return a.name + ':' + a.value;
                    } else {
                        var str = a[0].name + '<br/>';
                        var value = null;
                        for (var i = 0; i < a.length; i++) {
                            value = a[i].seriesId.split('-')[0] === $.i18n.prop('share.unit.tai') ? fix0(a[i].value) : fix2(a[i].value);
                            str += a[i].seriesName + '：' + value + a[i].seriesId.split('-')[0] + '<br/>';
                        }
                        return str;
                    }
                }
            },
            legend: {
                x: "right",
                textStyle: {color: '#AAA', fontSize: 0.28 * rem},
                data: [$.i18n.prop('index.overview.yyks.sbje'), $.i18n.prop('index.overview.yyks.sbsl')]
            },
            grid: {
                top: 1.2 * rem,
                left: 0.4 * rem,
                right: 0.4 * rem,
                bottom: 0.8 * rem,
                top: 1.6 * rem,
                containLabel: true
            },
            xAxis: {
                type: 'category', data: [],
                axisLabel: {rotate: 30, fontWeight: 100, fontSize: 0.24 * rem, textStyle: {color: '#fff'}},
                nameTextStyle: {color: '#fff', fontSize: 0.28 * rem},
                splitLine: {show: false, lineStyle: {color: '#f00', type: 'dashed'}},
                axisLine: {lineStyle: {color: '#fff'}},
                axisTick: {lineStyle: {color: '#fff'}}
            },
            yAxis: [{
                name: $.i18n.prop('share.unit.wanyuan'), type: 'value',
                splitLine: {lineStyle: {type: 'dashed'}},
                axisLabel: {fontSize: 0.28 * rem, textStyle: {color: '#fff'}},
                nameTextStyle: {color: '#fff', fontSize: 0.28 * rem},
                axisLine: {lineStyle: {color: '#fff'}},
                axisTick: {lineStyle: {color: '#fff'}}
            }, {
                name: $.i18n.prop('share.unit.tai'), type: 'value',
                splitLine: {show: false, lineStyle: {type: 'dashed'}},
                axisLabel: {fontSize: 0.28 * rem, textStyle: {color: '#fff'}},
                nameTextStyle: {color: '#fff', fontSize: 0.28 * rem},
                axisLine: {lineStyle: {color: '#fff'}},
                axisTick: {lineStyle: {color: '#fff'}}
            }],
            series: [
                {id: $.i18n.prop('share.unit.wanyuan') + '-2', name: $.i18n.prop('index.overview.yyks.sbje'), type: 'bar', barMaxWidth: 0.8 * rem, barGap: '0%', data: []},
                {id: $.i18n.prop('share.unit.tai') + '-3', name: $.i18n.prop('index.overview.yyks.sbsl'), type: 'bar', barMaxWidth: 0.8 * rem, data: []}
            ]
        }
    };
    /* Top5对象 */
    $containerObj.top5Obj = {
        main: $containerObj.main.find('.main-top5'), // top5主对象
        data: {}, // top5数据存储 hospital、type、assets、year
        status: {
            array: {},
            getStatus: function () {
                var arr = $headerObj.page[$headerObj.page.current].query;
                for (var i = 0; i < arr.length; i++) {
                    if (!this.array[arr[i]]) return false;
                }
                return true;
            },
            resetStatus: function () {
                for (var key in this.array) {
                    this.array[key] = false;
                }
            }
        },
        /* top5对象初始化方法 */
        init: function () {
            var top5Title = this.main.find('.top5-title');
            this.percentName = top5Title.find('.top5-value1');
            this.countName = top5Title.find('.top5-value2');
        },
        /* 切换显示 月份显示（传值） or 全部显示 */
        changeShow: function (value) {
            if (value) {
                this.main.find('.top5').hide();
                this.main.find('.top5-year, .top5-assets').show();
            } else {
                this.main.find('.top5-year').hide().siblings('.top5').show();
            }
        },
        /* 转化top5数据 */
        convertData: function (tag, start, end, index) {
            this.status.array[tag] = true;
            var data = $.extend({}, $containerObj.data);
            /* 设置设备类型的top5数据 */
            if (tag === 'type') data.type = data.type.list[-1].list ? data.type.list[-1] : {list: []};
            this.data[tag] = [];
            if ($containerObj.brandTag === '0') {
                (data[tag].list || []).sortByKey('curPrice'); // 按照设备金额排序
                this.percentName.textAndTitle($.i18n.prop('share.assets.nxzs'));
                this.countName.textAndTitle($.i18n.prop('share.assets.sbje(wy)'));
                this.percentName.eq(-1).textAndTitle($.i18n.prop('index.table.zb'));
                for (var i = start; i < end; i++) {
                    this.data[tag].push([
                        data[tag].list[i].name,
                        data[tag].list[i].id,
                        fix2(data[tag].list[i][tag === 'assets' ? 'price' : 'curPrice'] / PRICE_CONVERT),
                        tag === 'assets'
                            ? fix2(data[tag].list[i].price / data[tag].list[-1].price)
                            : fix2(data[tag].list[i].curAgeLimitMeasure),
                        i === index
                    ]);
                }
            } else if ($containerObj.brandTag === '1') {
                (data[tag].list || []).sortByKey('curEstimateCostWanyuan'); // 按照万元维修金额排序
                this.percentName.textAndTitle($.i18n.prop('maintain.table.blsj(c)'));
                this.countName.textAndTitle($.i18n.prop('maintainer.table.wxcs(c)'));
                for (var i = start; i < end; i++) {
                    this.data[tag].push([
                        data[tag].list[i].name,
                        data[tag].list[i].id,
                        fix0(data[tag].list[i].curToRepairCounts),
                        fix0(data[tag].list[i].curFaultCounts),
                        i === index
                    ]);
                }
            }
            this.setData(tag, start + 1);
            if (this.status.getStatus()) {
                loading(true);
                this.status.resetStatus();
            }
        },
        /* 设置top5数据 */
        setData: function (tag, start) {
            var str = '',
                active = '';
            for (var i = 0; i < this.data[tag].length; i++) {
                active = this.data[tag][i][4] ? ' class="active"' : '';
                str += (
                    '<li><a' + active + '>' +
                    '<span onclick="$containerObj.query(\'' + tag + '\',\'' + this.data[tag][i][1] + '\')" ' +
                    'title="' + (start + i) + ' ' + fixStr(this.data[tag][i][0]) + '" class="top5-key underline">' + fixStr(this.data[tag][i][0]) + '</span>' +
                    '<span class="top5-value1 jqmeter">' + this.data[tag][i][3] + '</span>' +
                    '<span class="top5-value2 jqmeter">' + this.data[tag][i][2] + '</span>' +
                    '</a></li>'
                );
            }
            this.main.find('.top5-' + tag + ' ul').html(str);
            if ($containerObj.maintainTag === '2') this.initJQMeter(tag);
        },
        /* 初始化进度条 */
        initJQMeter: function (tag) {
            this.main.find('.top5-' + tag + ' .jqmeter').each(function () {
                $(this).jQMeter({
                    goal: '$1,00',
                    raised: '$' + parseInt($(this).text()),
                    width: '90%',
                    height: '0.24rem'
                });
            });
        }
    };
    /* 模态框对象 */
    $containerObj.modalObj = {
        main: $('#detail-modal'), // 模态框主对象
        assetsMain: $('#assets-modal'), // 设备、新增、报废设备详情， 覆盖 header
        yearMain: $('#year-modal'), // 月份显示模态框
        data: {}, // 模态框数据
        /* 初始化模态框对象 */
        init: function () {
            this.initModal(); // 初始化模态框
            this.bindEvent(); // 绑定事件
        },
        /* 初始化模态框 */
        initModal: function () {
            var $this = this;
            /* 月份显示模态框 */
            this.yearMain.iziModal({
                title: 'title',
                headerColor: '#222431',
                width: '100%',
                radius: 3,
                zindex: 70,
                history: false,
                bodyOverflow: true,
                fullscreen: true,
                overlayColor: 'rgba(0, 0, 0, 0)',
                onOpening: function () {
                    /* 添加导出按钮 */
                    if (!$this.yearMain.find('.iziModal-header').find('.export_excel').length) {
                        $this.yearMain.find('.iziModal-header').append('<a class="iziModal-button export_excel"' +
                            ' href="javascript:void(0);" onclick="exportExcel(\'#year-modal\')" title="' + $.i18n.prop('share.sift.dc') + '"><i class="fa' +
                            ' fa-upload"></i></a>');
                    }
                },
                onOpened: function () {
                    /* 设置模态框高度 */
                    var height = $this.yearMain.height() - $this.yearMain.find('.iziModal-header').outerHeight();
                    $this.yearMain.find('.iziModal-content').height(height);
                }
            });
            /* 主模态框 */
            this.main.iziModal({
                title: 'title',
                headerColor: '#222431',
                width: '100%',
                radius: 3,
                zindex: 80,
                history: false,
                bodyOverflow: true,
                fullscreen: true,
                overlayColor: 'rgba(0, 0, 0, 0)',
                onOpening: function () {
                    /* 添加导出按钮 */
                    if (!$this.main.find('.iziModal-header').find('.export_excel').length) {
                        $this.main.find('.iziModal-header').append('<a class="iziModal-button export_excel" href="javascript:void(0);" onclick="exportExcel(\'#detail-modal\')" title="' + $.i18n.prop('share.sift.dc') + '"><i class="fa fa-upload"></i></a>');
                    }
                },
                onOpened: function () {
                    /* 设置模态框高度 */
                    var height = $this.main.height() - $this.main.find('.iziModal-header').outerHeight();
                    $this.main.find('.iziModal-content').height(height);
                }
            });
            /* 设备、新增、报废模态框 */
            this.assetsMain.iziModal({
                title: $.i18n.prop('share.talbe.sbxq'),
                headerColor: '#222431',
                width: '100%',
                radius: 3,
                zindex: 111,
                history: false,
                bodyOverflow: true,
                fullscreen: true,
                overlayColor: 'rgba(0, 0, 0, 0)',
                onOpening: function () {
                    /* 添加导出按钮 */
                    if (!$this.assetsMain.find('.iziModal-header').find('.export_excel').length) {
                        $this.assetsMain.find('.iziModal-header').append('<a class="iziModal-button export_excel" href="javascript:void(0);" onclick="exportExcel(\'#assets-modal\')" title="' + $.i18n.prop('share.sift.dc') + '"><i class="fa fa-upload"></i></a>');
                    }
                },
                onOpened: function () {
                    /* 设置模态框高度 */
                    var height = $this.assetsMain.height() - $this.assetsMain.find('.iziModal-header').outerHeight();
                    $this.assetsMain.find('.iziModal-content').height(height);
                }
            });
            // 月份显示表格对象
            this.yearTable = this.yearMain.find('#year-table');
            this.yearThead = this.yearTable.find('thead');
            this.yearTbody = this.yearTable.find('tbody');
            this.yearTfoot = this.yearTable.find('tfoot');
            // 主表格对象
            this.table = this.main.find('#detail-table');
            this.thead = this.table.find('thead');
            this.tbody = this.table.find('tbody');
            this.tfoot = this.table.find('tfoot');
            // 设备表格对象
            this.assetsTable = this.assetsMain.find('#assets-table');
            this.assetsThead = this.assetsTable.find('thead');
            this.assetsTbody = this.assetsTable.find('tbody');
            this.assetsTfoot = this.assetsTable.find('tfoot');
        },
        /* 设置模态框数据 */
        setModal: function (tag, key, sorting, param) {
            var $this = this;
            loading(function () {
                var theadStr = '',
                    tbodyStr = '',
                    tfootStr = '',
                    list = ($this.data[tag].list || []).sortByKey(sorting, key);  // 数据列表根据key排序，sorting郑旭或倒序
                // 清空表格内容
                $this.thead.html('');
                $this.tbody.html('');
                $this.tfoot.html('');
                $this.main.data().tag = tag; // 设置tag，用于模态框显示时，筛选刷新模态框数据
                if (tag === 'hospital') {
                    $this.main.iziModal('setTitle', $.i18n.prop('share.table.title.yljgfbxq'));
                    theadStr = (
                        '<tr><th class="tc">#</th>' +
                        '<th class="sort tl" data-tag="' + tag + '" data-key="name">' + $.i18n.prop('index.table.yymc') + '</th>'
                    );
                    tfootStr = (
                        '<tr>' +
                        '<td class="tc">'+$.i18n.prop('share.table.tail.zj')+'</td>' +
                        '<td class="tl">' + list.length + '</td>'
                    );

                    if ($containerObj.brandTag === '0') {
                        theadStr += (
                            '<th class="sort tr" data-key="curPrice">'+$.i18n.prop('index.table.sbje(wy)')+'</th>' +
                            '<th class="sort tr" data-key="devicePriceYoy">'+$.i18n.prop('index.table.sbjetb(%)')+'</th>' +
                            '<th class="sort tr" data-key="curCounts">'+$.i18n.prop('index.table.sbsl(t)')+'</th>' +
                            '<th class="sort tr" data-key="deviceCountsYoy">'+$.i18n.prop('index.table.sbsltb(%)')+'</th>' +
                            '<th class="sort tr" data-key="typeCounts">'+$.i18n.prop('maintainer.table.sblxsl(z)')+'</th>' +
                            '<th class="sort tr" data-key="curDepreciationPrice">'+$.i18n.prop('index.table.zjje(wy)')+'</th>' +
                            '<th class="sort tr" data-key="depreciationRatio">'+$.i18n.prop('index.table.zjl(%)')+'</th>' +
                            '<th class="sort tr" data-key="depreciationYoy">'+$.i18n.prop('index.table.zjtb(%)')+'</th>' +
                            '<th class="sort tr" data-key="curAgeLimitMeasure">'+$.i18n.prop('index.table.nxzs')+'</th>' +
                            '</tr>'
                        );
                        tfootStr += (
                            '<td class="tr">' + fix2(list[-1].curPrice / PRICE_CONVERT) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].devicePriceYoy / list.length) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].curCounts) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].deviceCountsYoy / list.length) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].typeCounts) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curDepreciationPrice / PRICE_CONVERT) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].depreciationRatio / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].depreciationYoy / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curAgeLimitMeasure / list.length) + '</td>' +
                            '</tr>'
                        );
                    } else if ($containerObj.brandTag === '1') {
                        theadStr += (
                            '<th class="sort tr" data-key="curBigRepairCounts">'+$.i18n.prop('maintain.table.dwxsl(c)')+'</th>' +
                            '<th class="sort tr" data-key="curMiddleRepairCounts">'+$.i18n.prop('maintain.table.zwxsl(c)')+'</th>' +
                            '<th class="sort tr" data-key="curSmallRepairCounts">'+$.i18n.prop('maintain.table.xwxsl(c)')+'</th>' +
                            '<th class="sort tr" data-key="curToRepairCounts">'+$.i18n.prop('maintainer.table.wxcs(c)')+'</th>' +
                            '<th class="sort tr" data-key="curAvgRepairUsedMin">'+$.i18n.prop('maintainer.table.pjwxsj(fz)')+'</th>' +
                            '<th class="sort tr" data-key="curAvgResponseMin">'+$.i18n.prop('maintainer.table.pjxysj(fz)')+'</th>' +
                            '<th class="sort tr" data-key="curFaultCounts">'+$.i18n.prop('maintainer.assets.blsj(c)')+'</th>' +
                            '<th class="sort tr" data-key="curIntactRatio">'+$.i18n.prop('maintainer.assets.whl(%)')+'</th>' +
                            '<th class="sort tr" data-key="curOnceRepairRate">'+$.i18n.prop('maintainer.assets.ycxfl(%)')+'</th>' +
                            '<th class="sort tr" data-key="curUpkeepRate">'+$.i18n.prop('maintainer.assets.byl(%)')+'</th>' +
                            '</tr>'
                        );
                        tfootStr += (
                            '<td class="tr">' + fix0(list[-1].curBigRepairCounts) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].curMiddleRepairCounts) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].curSmallRepairCounts) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].curToRepairCounts) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curAvgRepairUsedMin / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curAvgResponseMin / list.length) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].curFaultCounts) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curIntactRatio / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curOnceRepairRate / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curUpkeepRate / list.length) + '</td>' +
                            '</tr>'
                        );
                    }
                    for (var i = 0; i < list.length; i++) {
                        tbodyStr += (
                            '<tr>' +
                            '<td class="tc">' + (i + 1) + '</td>' +
                            '<td class="spanTitle" onclick="$containerObj.query(\'' + tag + '\',\'' + list[i].id + '\')">' + fixStr(list[i].name) + '</td>'
                        );
                        if ($containerObj.brandTag === '0') {
                            tbodyStr += (
                                '<td class="tr">' + fix2(list[i].curPrice / PRICE_CONVERT) + '</td>' +
                                '<td class="tr">' + fix2(list[i].devicePriceYoy) + '</td>' +
                                '<td class="tr' + (list[i].curCounts ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'assets\',\'{hospitalId:[' + list[i].id + ']'+(param||'')+'}\',\'' + list[i].curCounts + '\')">' +
                                    fix0(list[i].curCounts) + '</td>' +
                                '<td class="tr">' + fix2(list[i].deviceCountsYoy) + '</td>' +
                                '<td class="tr">' + fix0(list[i].typeCounts) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curDepreciationPrice / PRICE_CONVERT) + '</td>' +
                                '<td class="tr">' + fix2(list[i].depreciationRatio) + '</td>' +
                                '<td class="tr">' + fix2(list[i].depreciationYoy) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curAgeLimitMeasure) + '</td>' +
                                '</tr>'
                            );
                        } else if ($containerObj.brandTag === '1') {
                            tbodyStr += (
                                '<td class="tr">' + fix0(list[i].curBigRepairCounts) + '</td>' +
                                '<td class="tr">' + fix0(list[i].curMiddleRepairCounts) + '</td>' +
                                '<td class="tr">' + fix0(list[i].curSmallRepairCounts) + '</td>' +
                                '<td class="tr">' + fix0(list[i].curToRepairCounts) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curAvgRepairUsedMin) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curAvgResponseMin) + '</td>' +
                                '<td class="tr">' + fix0(list[i].curFaultCounts) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curIntactRatio) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curOnceRepairRate) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curUpkeepRate) + '</td>' +
                                '</tr>'
                            );
                        }
                    }
                } else if (tag === 'type') {
                    list[-1].list = list[-1].list || [];
                    $this.main.iziModal('setTitle', $.i18n.prop('share.table.title.sblxfbxq'));
                    theadStr = (
                        '<tr><th class="tl">'+$.i18n.prop('index.table.yjsb')+'</th>' +
                        '<th class="sort tl" data-key="name">'+$.i18n.prop('share.table.head.sblx')+'</th>'
                    );
                    tfootStr = (
                        '<tr>' +
                        '<td class="tl">'+$.i18n.prop('share.table.tail.zj')+' ' + list.length + '</td>' +
                        '<td class="tl">' + list[-1].list.length + '</td>'
                    );
                    if ($containerObj.brandTag === '0') {
                        theadStr += (
                            '<th class="sort tr" data-key="curPrice">'+$.i18n.prop('index.table.sbje(wy)')+'</th>' +
                            '<th class="sort tr" data-key="devicePriceYoy">'+$.i18n.prop('index.table.sbjetb(%)')+'</th>' +
                            '<th class="sort tr" data-key="curCounts">'+$.i18n.prop('index.table.sbsl(t)')+'</th>' +
                            '<th class="sort tr" data-key="deviceCountsYoy">'+$.i18n.prop('index.table.sbsltb(%)')+'</th>' +
                            '<th class="sort tr" data-key="typeCounts">'+$.i18n.prop('maintainer.table.sblxsl(z)')+'</th>' +
                            '<th class="sort tr" data-key="curDepreciationPrice">'+$.i18n.prop('index.table.zjje(wy)')+'</th>' +
                            '<th class="sort tr" data-key="depreciationRatio">'+$.i18n.prop('index.table.zjl(%)')+'</th>' +
                            '<th class="sort tr" data-key="depreciationYoy">'+$.i18n.prop('index.table.zjtb(%)')+'</th>' +
                            '<th class="sort tr" data-key="curAgeLimitMeasure">'+$.i18n.prop('index.table.nxzs')+'</th>' +
                            '</tr>'
                        );
                        tfootStr += (
                            '<td class="tr">' + fix2(list[-1].curPrice / PRICE_CONVERT) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].devicePriceYoy / list[-1].list.length) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].curCounts) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].deviceCountsYoy / list[-1].list.length) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].typeCounts) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curDepreciationPrice / PRICE_CONVERT) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].depreciationRatio / list[-1].list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].depreciationYoy / list[-1].list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curAgeLimitMeasure / list[-1].list.length) + '</td>' +
                            '</tr>'
                        );
                    } else if ($containerObj.brandTag === '1') {
                        theadStr += (
                            '<th class="sort tr" data-key="curBigRepairCounts">'+$.i18n.prop('maintain.table.dwxsl(c)')+'</th>' +
                            '<th class="sort tr" data-key="curMiddleRepairCounts">'+$.i18n.prop('maintain.table.zwxsl(c)')+'</th>' +
                            '<th class="sort tr" data-key="curSmallRepairCounts">'+$.i18n.prop('maintain.table.xwxsl(c)')+'</th>' +
                            '<th class="sort tr" data-key="curToRepairCounts">'+$.i18n.prop('maintainer.table.wxcs(c)')+'</th>' +
                            '<th class="sort tr" data-key="curAvgRepairUsedMin">'+$.i18n.prop('maintainer.table.pjwxsj(fz)')+'</th>' +
                            '<th class="sort tr" data-key="curAvgResponseMin">'+$.i18n.prop('maintainer.table.pjxysj(fz)')+'</th>' +
                            '<th class="sort tr" data-key="curFaultCounts">'+$.i18n.prop('maintainer.assets.blsj(c)')+'</th>' +
                            '<th class="sort tr" data-key="curIntactRatio">'+$.i18n.prop('maintainer.assets.whl(%)')+'</th>' +
                            '<th class="sort tr" data-key="curOnceRepairRate">'+$.i18n.prop('maintainer.assets.ycxfl(%)')+'</th>' +
                            '<th class="sort tr" data-key="curUpkeepRate">'+$.i18n.prop('maintainer.assets.byl(%)')+'</th>' +
                            '</tr>'
                        );
                        tfootStr += (
                            '<td class="tr">' + fix0(list[-1].curBigRepairCounts) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].curMiddleRepairCounts) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].curSmallRepairCounts) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].curToRepairCounts) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curAvgRepairUsedMin / list[-1].list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curAvgResponseMin / list[-1].list.length) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].curFaultCounts) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curIntactRatio / list[-1].list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curOnceRepairRate / list[-1].list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curUpkeepRate / list[-1].list.length) + '</td>' +
                            '</tr>'
                        );
                    }
                    for (var i = 0; i < list.length; i++) {
                        tbodyStr += (
                            '<tr>' +
                            '<td class="tl border-bottom" rowspan="' + (list[i].list.length + 1) + '">' + fixStr(list[i].name) + '</td>' +
                            '<td class="tl">'+$.i18n.prop('share.table.tail.xj')+'</td>'
                        );
                        if ($containerObj.brandTag === '0') {
                            tbodyStr += (
                                '<td class="tr">' + fix2(list[i].curPrice / PRICE_CONVERT) + '</td>' +
                                '<td class="tr">' + fix2(list[i].devicePriceYoy) + '</td>' +
                                '<td class="tr' + (list[i].curCounts ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'assets\',\'{typeId:[' + list[i].id + ']}\',\'' + list[i].curCounts + '\')">' +
                                    fix0(list[i].curCounts) + '</td>' +
                                '<td class="tr">' + fix2(list[i].deviceCountsYoy) + '</td>' +
                                '<td class="tr">' + fix0(list[i].typeCounts) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curDepreciationPrice / PRICE_CONVERT) + '</td>' +
                                '<td class="tr">' + fix2(list[i].depreciationRatio) + '</td>' +
                                '<td class="tr">' + fix2(list[i].depreciationYoy) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curAgeLimitMeasure) + '</td>' +
                                '</tr>'
                            );
                        } else if ($containerObj.brandTag === '1') {
                            tbodyStr += (
                                '<td class="tr">' + fix0(list[i].curBigRepairCounts) + '</td>' +
                                '<td class="tr">' + fix0(list[i].curMiddleRepairCounts) + '</td>' +
                                '<td class="tr">' + fix0(list[i].curSmallRepairCounts) + '</td>' +
                                '<td class="tr">' + fix0(list[i].curToRepairCounts) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curAvgRepairUsedMin) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curAvgResponseMin) + '</td>' +
                                '<td class="tr">' + fix0(list[i].curFaultCounts) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curIntactRatio) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curOnceRepairRate) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curUpkeepRate) + '</td>' +
                                '</tr>'
                            );
                        }
                        var selist = list[i].list;
                        for (var k = 0; k < selist.length; k++) {
                            tbodyStr += (
                                '<tr' + (k === selist.length - 1 ? ' class="border-bottom"' : '') + '>' +
                                '<td class="spanTitle" onclick="$containerObj.query(\'' + tag + '\',\'' + selist[k].id + '\')">' + fixStr(selist[k].name) + '</td>'
                            );
                            if ($containerObj.brandTag === '0') {
                                tbodyStr += (
                                    '<td class="tr">' + fix2(selist[k].curPrice / PRICE_CONVERT) + '</td>' +
                                    '<td class="tr">' + fix2(selist[k].devicePriceYoy) + '</td>' +
                                    '<td class="tr' + (selist[k].curCounts ? ' spanTitle' : '') +
                                        '" onclick="$containerObj.modalObj.query(\'assets\',\'{typeId:[' + selist[k].id + ']}\',\'' + selist[k].curCounts + '\')">' +
                                        fix0(selist[k].curCounts) + '</td>' +
                                    '<td class="tr">' + fix2(selist[k].deviceCountsYoy) + '</td>' +
                                    '<td class="tr">' + fix0(selist[k].typeCounts) + '</td>' +
                                    '<td class="tr">' + fix2(selist[k].curDepreciationPrice / PRICE_CONVERT) + '</td>' +
                                    '<td class="tr">' + fix2(selist[k].depreciationRatio) + '</td>' +
                                    '<td class="tr">' + fix2(selist[k].depreciationYoy) + '</td>' +
                                    '<td class="tr">' + fix2(selist[k].curAgeLimitMeasure) + '</td>' +
                                    '</tr>'
                                );
                            } else if ($containerObj.brandTag === '1') {
                                tbodyStr += (
                                    '<td class="tr">' + fix0(selist[k].curBigRepairCounts) + '</td>' +
                                    '<td class="tr">' + fix0(selist[k].curMiddleRepairCounts) + '</td>' +
                                    '<td class="tr">' + fix0(selist[k].curSmallRepairCounts) + '</td>' +
                                    '<td class="tr">' + fix0(selist[k].curToRepairCounts) + '</td>' +
                                    '<td class="tr">' + fix2(selist[k].curAvgRepairUsedMin) + '</td>' +
                                    '<td class="tr">' + fix2(selist[k].curAvgResponseMin) + '</td>' +
                                    '<td class="tr">' + fix0(selist[k].curFaultCounts) + '</td>' +
                                    '<td class="tr">' + fix2(selist[k].curIntactRatio) + '</td>' +
                                    '<td class="tr">' + fix2(selist[k].curOnceRepairRate) + '</td>' +
                                    '<td class="tr">' + fix2(selist[k].curUpkeepRate) + '</td>' +
                                    '</tr>'
                                );
                            }
                        }
                    }
                } else if (tag === 'model') {
                    $this.main.iziModal('setTitle', $.i18n.prop('share.table.title.sbxhfbxq'));
                    theadStr = (
                        '<tr><th class="tc">#</th>' +
                        '<th class="sort tl" data-tag="' + tag + '" data-key="name">'+$.i18n.prop('share.table.head.sbxh')+'</th>'
                    );
                    tfootStr = (
                        '<tr>' +
                        '<td class="tl">'+$.i18n.prop('share.table.tail.zj')+'</td>' +
                        '<td class="tl">' + list.length + '</td>'
                    );

                    if ($containerObj.brandTag === '0') {
                        theadStr += (
                            '<th class="sort tr" data-key="curPrice">'+$.i18n.prop('index.table.sbje(wy)')+'</th>' +
                            '<th class="sort tr" data-key="devicePriceYoy">'+$.i18n.prop('index.table.sbjetb(%)')+'</th>' +
                            '<th class="sort tr" data-key="curCounts">'+$.i18n.prop('index.table.sbsl(t)')+'</th>' +
                            '<th class="sort tr" data-key="deviceCountsYoy">'+$.i18n.prop('index.table.sbsltb(%)')+'</th>' +
                            '<th class="sort tr" data-key="typeCounts">'+$.i18n.prop('maintainer.table.sblxsl(z)')+'</th>' +
                            '<th class="sort tr" data-key="curDepreciationPrice">'+$.i18n.prop('index.table.zjje(wy)')+'</th>' +
                            '<th class="sort tr" data-key="depreciationRatio">'+$.i18n.prop('index.table.zjl(%)')+'</th>' +
                            '<th class="sort tr" data-key="depreciationYoy">'+$.i18n.prop('index.table.zjtb(%)')+'</th>' +
                            '<th class="sort tr" data-key="curAgeLimitMeasure">'+$.i18n.prop('index.table.nxzs')+'</th>' +
                            '</tr>'
                        );
                        tfootStr += (
                            '<td class="tr">' + fix2(list[-1].curPrice / PRICE_CONVERT) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].devicePriceYoy / list.length) + '</td>' +
                            '<td class="tr' + (list[-1].curCounts ? ' spanTitle' : '') +
                                '" onclick="$containerObj.modalObj.query(\'assets\',\'{modelName:' + list[-1].id + '}\',\'' + list[-1].curCounts + '\')">' +
                                fix0(list[-1].curCounts) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].deviceCountsYoy / list.length) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].typeCounts) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curDepreciationPrice / PRICE_CONVERT) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].depreciationRatio / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].depreciationYoy / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curAgeLimitMeasure / list.length) + '</td>' +
                            '</tr>'
                        );
                    } else if ($containerObj.brandTag === '1') {
                        theadStr += (
                            '<th class="sort tr" data-key="curBigRepairCounts">'+$.i18n.prop('maintain.table.dwxsl(c)')+'</th>' +
                            '<th class="sort tr" data-key="curMiddleRepairCounts">'+$.i18n.prop('maintain.table.zwxsl(c)')+'</th>' +
                            '<th class="sort tr" data-key="curSmallRepairCounts">'+$.i18n.prop('maintain.table.xwxsl(c)')+'</th>' +
                            '<th class="sort tr" data-key="curToRepairCounts">'+$.i18n.prop('maintainer.table.wxcs(c)')+'</th>' +
                            '<th class="sort tr" data-key="curAvgRepairUsedMin">'+$.i18n.prop('maintainer.table.pjwxsj(fz)')+'</th>' +
                            '<th class="sort tr" data-key="curAvgResponseMin">'+$.i18n.prop('maintainer.table.pjxysj(fz)')+'</th>' +
                            '<th class="sort tr" data-key="curFaultCounts">'+$.i18n.prop('maintainer.assets.blsj(c)')+'</th>' +
                            '<th class="sort tr" data-key="curIntactRatio">'+$.i18n.prop('maintainer.assets.whl(%)')+'</th>' +
                            '<th class="sort tr" data-key="curOnceRepairRate">'+$.i18n.prop('maintainer.assets.ycxfl(%)')+'</th>' +
                            '<th class="sort tr" data-key="curUpkeepRate">'+$.i18n.prop('maintainer.assets.byl(%)')+'</th>' +
                            '</tr>'
                        );
                        tfootStr += (
                            '<td class="tr">' + fix0(list[-1].curBigRepairCounts) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].curMiddleRepairCounts) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].curSmallRepairCounts) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].curToRepairCounts) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curAvgRepairUsedMin / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curAvgResponseMin / list.length) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].curFaultCounts) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curIntactRatio / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curOnceRepairRate / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curUpkeepRate / list.length) + '</td>' +
                            '</tr>'
                        );
                    }
                    for (var i = 0; i < list.length; i++) {
                        tbodyStr += (
                            '<tr>' +
                            '<td class="tc">' + (i + 1) + '</td>' +
                            '<td class="spanTitle" onclick="$containerObj.query(\'' + tag + '\',\'' + list[i].id + '\')">' + fixStr(list[i].name) + '</td>'
                        );
                        if ($containerObj.brandTag === '0') {
                            tbodyStr += (
                                '<td class="tr">' + fix2(list[i].curPrice / PRICE_CONVERT) + '</td>' +
                                '<td class="tr">' + fix2(list[i].devicePriceYoy) + '</td>' +
                                '<td class="tr">' + fix0(list[i].curCounts) + '</td>' +
                                '<td class="tr">' + fix2(list[i].deviceCountsYoy) + '</td>' +
                                '<td class="tr">' + fix0(list[i].typeCounts) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curDepreciationPrice / PRICE_CONVERT) + '</td>' +
                                '<td class="tr">' + fix2(list[i].depreciationRatio) + '</td>' +
                                '<td class="tr">' + fix2(list[i].depreciationYoy) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curAgeLimitMeasure) + '</td>' +
                                '</tr>'
                            );
                        } else if ($containerObj.brandTag === '1') {
                            tbodyStr += (
                                '<td class="tr">' + fix0(list[i].curBigRepairCounts) + '</td>' +
                                '<td class="tr">' + fix0(list[i].curMiddleRepairCounts) + '</td>' +
                                '<td class="tr">' + fix0(list[i].curSmallRepairCounts) + '</td>' +
                                '<td class="tr">' + fix0(list[i].curToRepairCounts) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curAvgRepairUsedMin) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curAvgResponseMin) + '</td>' +
                                '<td class="tr">' + fix0(list[i].curFaultCounts) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curIntactRatio) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curOnceRepairRate) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curUpkeepRate) + '</td>' +
                                '</tr>'
                            );
                        }
                    }
                } else if (tag === 'assets') {
                    $this.main.iziModal('setTitle', $.i18n.prop('share.table.title.sbfbxq'));
                    theadStr = (
                        '<tr><th class="tc">#</th>' +
                        '<th class="sort tl" data-key="name">'+$.i18n.prop('share.assets.sbmc')+'</th>' +
                        '<th class="sort tl" data-key="firstTypeName">'+$.i18n.prop('share.table.head.sblx')+'</th>' +
                        '<th class="sort tl" data-key="modalName">'+$.i18n.prop('share.assets.sbxh')+'</th>' +
                        '<th class="sort tl" data-key="hospital">'+$.i18n.prop('share.assets.ssyy')+'</th>' +
                        '<th class="sort tl" data-key="department">'+$.i18n.prop('share.assets.ssks')+'</th>' +
                        '<th class="sort tl" data-key="manufacturer">'+$.i18n.prop('share.table.head.sbcj')+'</th>' +
                        '<th class="sort tl" data-key="sn">'+$.i18n.prop('share.assets.snbh')+'</th>' +
                        '<th class="sort tl" data-key="assetsNo">'+$.i18n.prop('share.assets.zcbh')+'</th>'
                    );
                    tfootStr = (
                        '<tr>' +
                        '<td class="tc">'+$.i18n.prop('share.table.tail.zj')+'</td>' +
                        '<td class="tl">' + list.length + '</td>' +
                        '<td class="tl"></td>' +
                        '<td class="tl"></td>' +
                        '<td class="tl"></td>' +
                        '<td class="tl"></td>' +
                        '<td class="tl"></td>' +
                        '<td class="tl"></td>' +
                        '<td class="tl"></td>'
                    );
                    if ($containerObj.brandTag === '0') {
                        theadStr += (
                            '<th class="sort tr" data-key="price">'+$.i18n.prop('share.assets.sbje(wy)')+'</th>' +
                            '<th class="sort tr" data-key="depreciationPrice">'+$.i18n.prop('share.assets.zjje(wy)')+'</th>' +
                            '<th class="sort tr" data-key="usedTime">'+$.i18n.prop('share.assets.ysysj(n)')+'</th>' +
                            '<th class="sort tr" data-key="ageLimitMeasure">'+$.i18n.prop('share.assets.nxzs')+'</th>' +
                            '</tr>'
                        );
                        tfootStr += (
                            '<td class="tr">' + fix2(list[-1].price / PRICE_CONVERT) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].depreciationPrice / PRICE_CONVERT) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].usedTime) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].ageLimitMeasure) + '</td>' +
                            '</tr>'
                        );
                    } else if ($containerObj.brandTag === '1') {
                        theadStr += (
                            '<th class="sort tr" data-key="curBigRepairCounts">'+$.i18n.prop('maintain.table.dwxsl(c)')+'</th>' +
                            '<th class="sort tr" data-key="curMiddleRepairCounts">'+$.i18n.prop('maintain.table.zwxsl(c)')+'</th>' +
                            '<th class="sort tr" data-key="curSmallRepairCounts">'+$.i18n.prop('maintain.table.xwxsl(c)')+'</th>' +
                            '<th class="sort tr" data-key="curToRepairCounts">'+$.i18n.prop('maintainer.table.wxcs(c)')+'</th>' +
                            '<th class="sort tr" data-key="curAvgRepairUsedMin">'+$.i18n.prop('maintainer.table.pjwxsj(fz)')+'</th>' +
                            '<th class="sort tr" data-key="curAvgResponseMin">'+$.i18n.prop('maintainer.table.pjxysj(fz)')+'</th>' +
                            '<th class="sort tr" data-key="curFaultCounts">'+$.i18n.prop('maintainer.assets.blsj(c)')+'</th>' +
                            '<th class="sort tr" data-key="curIntactRatio">'+$.i18n.prop('maintainer.assets.whl(%)')+'</th>' +
                            '<th class="sort tr" data-key="curOnceRepairRate">'+$.i18n.prop('maintainer.assets.ycxfl(%)')+'</th>' +
                            '<th class="sort tr" data-key="curUpkeepRate">'+$.i18n.prop('maintainer.assets.byl(%)')+'</th>' +
                            '</tr>'
                        );
                        tfootStr += (
                            '<td class="tr">' + fix0(list[-1].curBigRepairCounts) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].curMiddleRepairCounts) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].curSmallRepairCounts) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].curToRepairCounts) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curAvgRepairUsedMin / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curAvgResponseMin / list.length) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].curFaultCounts) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curIntactRatio / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curOnceRepairRate / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curUpkeepRate / list.length) + '</td>' +
                            '</tr>'
                        );
                    }
                    for (var i = 0; i < list.length; i++) {
                        tbodyStr += (
                            '<tr>' +
                            '<td class="tc">' + (i + 1) + '</td>' +
                            '<td class="spanTitle" onclick="$containerObj.query(\'' + tag + '\',\'' + list[i].id + '\')">' + fixStr(list[i].name) + '</td>' +
                            '<td class="tl">' + fixStr(list[i].firstTypeName) + '</td>' +
                            '<td class="tl">' + fixStr(list[i].modalName) + '</td>' +
                            '<td class="tl">' + fixStr(list[i].hospital) + '</td>' +
                            '<td class="tl">' + fixStr(list[i].department) + '</td>' +
                            '<td class="tl">' + fixStr(list[i].manufacturer) + '</td>' +
                            '<td class="tl">' + fixStr(list[i].sn) + '</td>' +
                            '<td class="tl">' + fixStr(list[i].assetsNo) + '</td>'
                        );
                        if ($containerObj.brandTag === '0') {
                            tbodyStr += (
                                '<td class="tr">' + fix2(list[i].price / PRICE_CONVERT) + '</td>' +
                                '<td class="tr">' + fix2(list[i].depreciationPrice / PRICE_CONVERT) + '</td>' +
                                '<td class="tr">' + fix2(list[i].usedTime) + '</td>' +
                                '<td class="tr">' + fix2(list[i].ageLimitMeasure) + '</td>' +
                                '</tr>'
                            );
                        } else if ($containerObj.brandTag === '1') {
                            tbodyStr += (
                                '<td class="tr">' + fix0(list[i].curBigRepairCounts) + '</td>' +
                                '<td class="tr">' + fix0(list[i].curMiddleRepairCounts) + '</td>' +
                                '<td class="tr">' + fix0(list[i].curSmallRepairCounts) + '</td>' +
                                '<td class="tr">' + fix0(list[i].curToRepairCounts) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curAvgRepairUsedMin) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curAvgResponseMin) + '</td>' +
                                '<td class="tr">' + fix0(list[i].curFaultCounts) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curIntactRatio) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curOnceRepairRate) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curUpkeepRate) + '</td>' +
                                '</tr>'
                            );
                        }
                    }
                } else if (tag === 'year') {
                    $this.yearMain.iziModal('setTitle', $.i18n.prop('charts.button.lnsj'));
                    theadStr = (
                        '<tr><th class="tc">#</th>' +
                        '<th class="sort tl" data-tag="year" data-key="name">'+$.i18n.prop('share.table.head.nf')+'</th>'
                    );
                    tfootStr = (
                        '<tr>' +
                        '<td class="tc">'+$.i18n.prop('share.table.tail.zj')+'</td>' +
                        '<td class="tl">' + list.length + '</td>'
                    );
                    if ($containerObj.brandTag === '0') {
                        theadStr += (
                            '<th class="sort tr" data-key="curPrice">'+$.i18n.prop('index.table.sbje(wy)')+'</th>' +
                            '<th class="sort tr" data-key="devicePriceYoy">'+$.i18n.prop('index.table.sbjetb(%)')+'</th>' +
                            '<th class="sort tr" data-key="curCounts">'+$.i18n.prop('index.table.sbsl(t)')+'</th>' +
                            '<th class="sort tr" data-key="deviceCountsYoy">'+$.i18n.prop('index.table.sbsltb(%)')+'</th>' +
                            '<th class="sort tr" data-key="typeCounts">'+$.i18n.prop('maintainer.table.sblxsl(z)')+'</th>' +
                            '<th class="sort tr" data-key="curDepreciationPrice">'+$.i18n.prop('index.table.zjje(wy)')+'</th>' +
                            '<th class="sort tr" data-key="depreciationRatio">'+$.i18n.prop('index.table.zjl(%)')+'</th>' +
                            '<th class="sort tr" data-key="depreciationYoy">'+$.i18n.prop('index.table.zjtb(%)')+'</th>' +
                            '<th class="sort tr" data-key="curAgeLimitMeasure">'+$.i18n.prop('index.table.nxzs')+'</th>' +
                            '</tr>'
                        );
                        tfootStr += (
                            '<td class="tr">' + fix2(list[-1].curPrice / PRICE_CONVERT) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].devicePriceYoy / list.length) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].curCounts) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].deviceCountsYoy / list.length) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].typeCounts) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curDepreciationPrice / PRICE_CONVERT) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].depreciationRatio / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].depreciationYoy / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curAgeLimitMeasure / list.length) + '</td>' +
                            '</tr>'
                        );
                    } else if ($containerObj.brandTag === '1') {
                        theadStr += (
                            '<th class="sort tr" data-key="curBigRepairCounts">'+$.i18n.prop('maintain.table.dwxsl(c)')+'</th>' +
                            '<th class="sort tr" data-key="curMiddleRepairCounts">'+$.i18n.prop('maintain.table.zwxsl(c)')+'</th>' +
                            '<th class="sort tr" data-key="curSmallRepairCounts">'+$.i18n.prop('maintain.table.xwxsl(c)')+'</th>' +
                            '<th class="sort tr" data-key="curToRepairCounts">'+$.i18n.prop('maintainer.table.wxcs(c)')+'</th>' +
                            '<th class="sort tr" data-key="curAvgRepairUsedMin">'+$.i18n.prop('maintainer.table.pjwxsj(fz)')+'</th>' +
                            '<th class="sort tr" data-key="curAvgResponseMin">'+$.i18n.prop('maintainer.table.pjxysj(fz)')+'</th>' +
                            '<th class="sort tr" data-key="curFaultCounts">'+$.i18n.prop('maintainer.assets.blsj(c)')+'</th>' +
                            '<th class="sort tr" data-key="curIntactRatio">'+$.i18n.prop('maintainer.assets.whl(%)')+'</th>' +
                            '<th class="sort tr" data-key="curOnceRepairRate">'+$.i18n.prop('maintainer.assets.ycxfl(%)')+'</th>' +
                            '<th class="sort tr" data-key="curUpkeepRate">'+$.i18n.prop('maintainer.assets.byl(%)')+'</th>' +
                            '</tr>'
                        );
                        tfootStr += (
                            '<td class="tr">' + fix0(list[-1].curBigRepairCounts) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].curMiddleRepairCounts) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].curSmallRepairCounts) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].curToRepairCounts) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curAvgRepairUsedMin / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curAvgResponseMin / list.length) + '</td>' +
                            '<td class="tr">' + fix0(list[-1].curFaultCounts) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curIntactRatio / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curOnceRepairRate / list.length) + '</td>' +
                            '<td class="tr">' + fix2(list[-1].curUpkeepRate / list.length) + '</td>' +
                            '</tr>'
                        );
                    }
                    for (var i = 0; i < list.length; i++) {
                        tbodyStr += (
                            '<tr>' +
                            '<td class="tc">' + (i + 1) + '</td>' +
                            '<td class="spanTitle" onclick="$containerObj.query(\'' + tag + '\',\'' + list[i].id + '\')">' + fixStr(list[i].name) + '</td>'
                        );
                        if ($containerObj.brandTag === '0') {
                            tbodyStr += (
                                '<td class="tr">' + fix2(list[i].curPrice / PRICE_CONVERT) + '</td>' +
                                '<td class="tr">' + fix2(list[i].devicePriceYoy) + '</td>' +
                                '<td class="tr' + (list[i].curCounts ? ' spanTitle' : '') +
                                    '" onclick="$containerObj.modalObj.query(\'assets\',\'{year:' + list[i].id + '}\',\'' + list[i].curCounts + '\')">' +
                                    fix0(list[i].curCounts) + '</td>' +
                                '<td class="tr">' + fix2(list[i].deviceCountsYoy) + '</td>' +
                                '<td class="tr">' + fix0(list[i].typeCounts) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curDepreciationPrice / PRICE_CONVERT) + '</td>' +
                                '<td class="tr">' + fix2(list[i].depreciationRatio) + '</td>' +
                                '<td class="tr">' + fix2(list[i].depreciationYoy) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curAgeLimitMeasure) + '</td>' +
                                '</tr>'
                            );
                        } else if ($containerObj.brandTag === '1') {
                            tbodyStr += (
                                '<td class="tr">' + fix0(list[i].curBigRepairCounts) + '</td>' +
                                '<td class="tr">' + fix0(list[i].curMiddleRepairCounts) + '</td>' +
                                '<td class="tr">' + fix0(list[i].curSmallRepairCounts) + '</td>' +
                                '<td class="tr">' + fix0(list[i].curToRepairCounts) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curAvgRepairUsedMin) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curAvgResponseMin) + '</td>' +
                                '<td class="tr">' + fix0(list[i].curFaultCounts) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curIntactRatio) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curOnceRepairRate) + '</td>' +
                                '<td class="tr">' + fix2(list[i].curUpkeepRate) + '</td>' +
                                '</tr>'
                            );
                        }
                    }
                }
                var table, thead, tbody, tfoot, main;
                if (tag === 'year') {
                    table = $this.yearTable;
                    thead = $this.yearThead;
                    tbody = $this.yearTbody;
                    tfoot = $this.yearTfoot;
                    main = $this.yearMain;
                } else {
                    table = $this.table;
                    thead = $this.thead;
                    tbody = $this.tbody;
                    tfoot = $this.tfoot;
                    main = $this.main;
                }
                thead.html(theadStr);
                tbody.html(tbodyStr);
                tfoot.html(tfootStr);
                /* 排序 */
                // 添加排序图片
                var sort = thead.find('.sort').append('<img src="' + basePath + 'plugins/charts/images/sort.png">').each(function () {
                    if (key === $(this).data().key) { // 根据sorting和key设置排序字段图片
                        $(this).find('img').attr('src', basePath + 'plugins/charts/images/sort_' + (sorting === 'desc' ? 'up' : 'down') + '.png');
                    }
                });
                /* 点击表头重新排序 */
                sort.on('click', function () {
                    var src = $(this).find('img').attr('src');
                    if (src.indexOf('sort_up.png') !== -1) {
                        $containerObj.modalObj.setModal(tag, $(this).data().key, 'asc');
                    } else if ((src.indexOf('sort_down.png') !== -1) || (src.indexOf('sort.png') !== -1)) {
                        $containerObj.modalObj.setModal(tag, $(this).data().key, 'desc');
                    }
                });
                main.iziModal('open');
                // 延时设置表格首尾固定，防止页面卡死
                setTimeout(function () {
                    // 如果列表长度大于200，则值固定表头表尾，不固定前两列，防止页面卡死
                    if (list.length > 200) {
                        table.tableHeadFixer({'head': true, 'foot': true});
                    } else {
                        table.tableHeadFixer({'left': 2, 'head': true, 'foot': true});
                    }
                    loading(true);
                }, 20);
            }, 20);
        },
        /* 绑定事件 */
        bindEvent: function () {
            var $this = this;
            // 点击详情按钮，设置对应数据，弹出模态框
            $containerObj.main.find('.detail-btn').on('click', function () {
                var tag = $(this).data().tag;
                var key = '';
                var sorting = 'desc';
                if (tag === 'assets') {
                    key = 'amount';
                } else if (tag === 'year') {
                    key = 'month';
                    sorting = 'asc';
                } else {
                    key = 'jnAssetsAmount';
                }
                $this.setModal(tag, key, sorting);
            })
        },
        /* 处理新增、报废、设备的点击 */
        query: function (tag, params, count) {
            if (count > 0) {
                var $this = this;
                loading(function () {
                    params = string2json(params);
                    if (tag === 'record') {
                        $this.queryAssetsTable('record', params);
                        $this.assetsMain.iziModal('setTitle', $.i18n.prop('share.talbe.wxjlxq'));
                    } else if (tag === 'assets') {
                        $this.queryAssetsTable('assets', params);
                        $this.assetsMain.iziModal('setTitle', $.i18n.prop('share.table.title.sbfbxq'));
                    } else if (tag === 'halt') {
                        $this.queryAssetsTable('halt', params);
                        $this.assetsMain.iziModal('setTitle', $.i18n.prop('share.talbe.djjlxq'));
                    }
                });
            }
        },
        /* 查询设备、新增、报废数据 */
        queryAssetsTable: function (url, params) {
            var $this = this;
            publicAjax(basePath + 'charts/area/brand/' + url, 'post', $.extend({}, $headerObj.searchObj.params, params), function (data) {
                $this.data.count = data.data;
                ($this.data.count.list || []).calTotal().sortByKey('');
                $this.setAssetsTable('', 'desc', url);
            }, true);
        },
        /* 设置设备、新增、报废表格数据 */
        setAssetsTable: function (key, sorting, tag) {
            var $this = this,
                theadStr = '',
                tbodyStr = '',
                tfootStr = '',
                list = (this.data.count.list || []).sortByKey(sorting, key);
            loading();
            if (tag === 'record') {
                theadStr = (
                    '<tr><th class="tc">#</th>' +
                    '<th class="sort tl" data-key="name">'+$.i18n.prop('share.table.head.sbmc')+'</th>' +
                    '<th class="sort tl" data-key="firstTypeName">'+$.i18n.prop('share.table.head.sblx')+'</th>' +
                    '<th class="sort tl" data-key="modalName">'+$.i18n.prop('share.table.head.sbxh')+'</th>' +
                    '<th class="sort tl" data-key="hospital">'+$.i18n.prop('share.assets.ssyy')+'</th>' +
                    '<th class="sort tl" data-key="department">'+$.i18n.prop('share.assets.ssks')+'</th>' +
                    '<th class="sort tl" data-key="sn">'+$.i18n.prop('share.assets.snbh')+'</th>' +
                    '<th class="sort tl" data-key="assetsNo">'+$.i18n.prop('share.assets.zcbh')+'</th>' +
                    '<th class="sort tl" data-key="qrcode">'+$.i18n.prop('maintian.record.ewm')+'</th>' +
                    '<th class="sort tl" data-key="repairTime">'+$.i18n.prop('maintian.record.bxsj')+'</th>' +
                    '<th class="sort tl" data-key="repairType">'+$.i18n.prop('maintian.record.wxfs')+'</th>' +
                    '<th class="sort tl" data-key="maintainer">'+$.i18n.prop('maintian.record.wxs')+'</th>' +
                    '<th class="sort tl" data-key="engineer">'+$.i18n.prop('maintian.record.gcs')+'</th>' +
                    '<th class="sort tl" data-key="repairSize">'+$.i18n.prop('maintian.record.wxdx')+'</th>' +
                    '<th class="sort tl" data-key="fault">'+$.i18n.prop('maintian.record.gzms')+'</th>' +
                    '<th class="sort tl" data-key="repairContent">'+$.i18n.prop('maintian.record.wxzdms')+'</th>' +
                    '<th class="sort tl" data-key="repairCondition">'+$.i18n.prop('maintian.record.bxqnw')+'</th>' +
                    '<th class="sort tr" data-key="ageLimitMeasure">'+$.i18n.prop('charts.select.nxzs')+'</th>' +
                    '<th class="sort tr" data-key="responseMin">'+$.i18n.prop('maintian.record.xysj(fz)')+'</th>' +
                    '<th class="sort tr" data-key="repairUsedMin">'+$.i18n.prop('maintian.record.wxsj(fz)')+'</th>' +
                    '<th class="sort tr" data-key="visitCounts">'+$.i18n.prop('maintian.record.smcs')+'</th>' +
                    '<th class="sort tr" data-key="estimateTotalCost">'+$.i18n.prop('maintian.record.gswxfy')+'</th>' +
                    '<th class="sort tr" data-key="partCounts">'+$.i18n.prop('maintian.record.bjghcs')+'</th>' +
                    '</tr>'
                );
                tfootStr = (
                    '<tr>' +
                    '<td class="tc">'+$.i18n.prop('share.table.tail.zj')+'</td>' +
                    '<td class="tl">' + list.length + '</td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tr">' + fix2(list[-1].ageLimitMeasure / list.length) + '</td>' +
                    '<td class="tr">' + fix0(list[-1].responseMin / list.length) + '</td>' +
                    '<td class="tr">' + fix0(list[-1].repairUsedMin / list.length) + '</td>' +
                    '<td class="tr">' + fix0(list[-1].visitCounts) + '</td>' +
                    '<td class="tr">' + fix2(list[-1].estimateTotalCost / 100) + '</td>' +
                    '<td class="tr">' + fix0(list[-1].partCounts) + '</td>' +
                    '</tr>'
                );
                for (var i = 0; i < list.length; i++) {
                    tbodyStr += (
                        '<tr>' +
                        '<td class="tc">' + (i + 1) + '</td>' +
                        '<td class="spanTitle" onclick="$containerObj.query(\'assets\',\'' + list[i].id + '\')">' + fixStr(list[i].name) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].firstTypeName) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].modalName) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].hospital) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].department) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].sn) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].assetsNo) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].qrcode) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].repairTime) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].repairType) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].maintainer) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].engineer) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].repairSize) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].fault) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].repairContent) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].repairCondition) + '</td>' +
                        '<td class="tr">' + fix2(list[i].ageLimitMeasure) + '</td>' +
                        '<td class="tr">' + fix0(list[i].responseMin) + '</td>' +
                        '<td class="tr">' + fix0(list[i].repairUsedMin) + '</td>' +
                        '<td class="tr">' + fix0(list[i].visitCounts) + '</td>' +
                        '<td class="tr">' + fix2(list[i].estimateTotalCost / 100) + '</td>' +
                        '<td class="tr">' + fix0(list[i].partCounts) + '</td>' +
                        '</tr>'
                    );
                }
            } else if (tag === 'assets') {
                theadStr = (
                    '<tr><th class="tc">#</th>' +
                    '<th class="sort tl" data-key="name">'+$.i18n.prop('share.table.head.sbmc')+'</th>' +
                    '<th class="sort tl" data-key="firstTypeName">'+$.i18n.prop('share.table.head.sblx')+'</th>' +
                    '<th class="sort tl" data-key="modalName">'+$.i18n.prop('share.table.head.sbxh')+'</th>' +
                    '<th class="sort tl" data-key="hospital">'+$.i18n.prop('share.assets.ssyy')+'</th>' +
                    '<th class="sort tl" data-key="department">'+$.i18n.prop('share.assets.ssks')+'</th>' +
                    '<th class="sort tl" data-key="sn">'+$.i18n.prop('share.assets.snbh')+'</th>' +
                    '<th class="sort tl" data-key="assetsNo">'+$.i18n.prop('share.assets.zcbh')+'</th>' +
                    '<th class="sort tl" data-key="manufacturer">'+$.i18n.prop('share.table.head.sbcj')+'</th>'
                );
                tfootStr = (
                    '<tr>' +
                    '<td class="tc">'+$.i18n.prop('share.table.tail.zj')+'</td>' +
                    '<td class="tl">' + list.length + '</td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>'
                );
                if ($containerObj.brandTag === '0') {
                    theadStr += (
                        '<th class="sort tr" data-key="price">'+$.i18n.prop('index.table.sbje(wy)')+'</th>' +
                        '<th class="sort tr" data-key="depreciationPrice">'+$.i18n.prop('index.table.zjje(wy)')+'</th>' +
                        '<th class="sort tr" data-key="usedTime">'+$.i18n.prop('share.assets.ysysj(n)')+'</th>' +
                        '<th class="sort tr" data-key="ageLimitMeasure">'+$.i18n.prop('index.table.nxzs')+'</th>' +
                        '</tr>'
                    );
                    tfootStr += (
                        '<td class="tr">' + fix2(list[-1].price / PRICE_CONVERT) + '</td>' +
                        '<td class="tr">' + fix2(list[-1].depreciationPrice / PRICE_CONVERT) + '</td>' +
                        '<td class="tr">' + fix2(list[-1].usedTime) + '</td>' +
                        '<td class="tr">' + fix2(list[-1].ageLimitMeasure) + '</td>' +
                        '</tr>'
                    );
                } else if ($containerObj.brandTag === '1') {
                    theadStr += (
                        '<th class="sort tr" data-key="curBigRepairCounts">'+$.i18n.prop('maintain.table.dwxsl(c)')+'</th>' +
                        '<th class="sort tr" data-key="curMiddleRepairCounts">'+$.i18n.prop('maintain.table.zwxsl(c)')+'</th>' +
                        '<th class="sort tr" data-key="curSmallRepairCounts">'+$.i18n.prop('maintain.table.xwxsl(c)')+'</th>' +
                        '<th class="sort tr" data-key="curToRepairCounts">'+$.i18n.prop('maintainer.table.wxcs(c)')+'</th>' +
                        '<th class="sort tr" data-key="curAvgRepairUsedMin">'+$.i18n.prop('maintainer.table.pjwxsj(fz)')+'</th>' +
                        '<th class="sort tr" data-key="curAvgResponseMin">'+$.i18n.prop('maintainer.table.pjxysj(fz)')+'</th>' +
                        '<th class="sort tr" data-key="curFaultCounts">'+$.i18n.prop('maintainer.assets.blsj(c)')+'</th>' +
                        '<th class="sort tr" data-key="curIntactRatio">'+$.i18n.prop('maintainer.assets.whl(%)')+'</th>' +
                        '<th class="sort tr" data-key="curOnceRepairRate">'+$.i18n.prop('maintainer.assets.ycxfl(%)')+'</th>' +
                        '<th class="sort tr" data-key="curUpkeepRate">'+$.i18n.prop('maintainer.assets.byl(%)')+'</th>' +
                        '</tr>'
                    );
                    tfootStr += (
                        '<td class="tr">' + fix0(list[-1].curBigRepairCounts) + '</td>' +
                        '<td class="tr">' + fix0(list[-1].curMiddleRepairCounts) + '</td>' +
                        '<td class="tr">' + fix0(list[-1].curSmallRepairCounts) + '</td>' +
                        '<td class="tr">' + fix0(list[-1].curToRepairCounts) + '</td>' +
                        '<td class="tr">' + fix2(list[-1].curAvgRepairUsedMin / list.length) + '</td>' +
                        '<td class="tr">' + fix2(list[-1].curAvgResponseMin / list.length) + '</td>' +
                        '<td class="tr">' + fix0(list[-1].curFaultCounts) + '</td>' +
                        '<td class="tr">' + fix2(list[-1].curIntactRatio / list.length) + '</td>' +
                        '<td class="tr">' + fix2(list[-1].curOnceRepairRate / list.length) + '</td>' +
                        '<td class="tr">' + fix2(list[-1].curUpkeepRate / list.length) + '</td>' +
                        '</tr>'
                    );
                }
                for (var i = 0; i < list.length; i++) {
                    tbodyStr += (
                        '<tr>' +
                        '<td class="tc">' + (i + 1) + '</td>' +
                        '<td class="spanTitle" onclick="$containerObj.query(\'assets\',\'' + list[i].id + '\')">' + fixStr(list[i].name) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].firstTypeName) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].modalName) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].hospital) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].department) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].sn) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].assetsNo) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].manufacturer) + '</td>'
                    );
                    if ($containerObj.brandTag === '0') {
                        tbodyStr += (
                            '<td class="tr">' + fix2(list[i].price / PRICE_CONVERT) + '</td>' +
                            '<td class="tr">' + fix2(list[i].depreciationPrice / PRICE_CONVERT) + '</td>' +
                            '<td class="tr">' + fix2(list[i].usedTime) + '</td>' +
                            '<td class="tr">' + fix2(list[i].ageLimitMeasure) + '</td>' +
                            '</tr>'
                        );
                    } else if ($containerObj.brandTag === '1') {
                        tbodyStr += (
                            '<td class="tr">' + fix0(list[i].curBigRepairCounts) + '</td>' +
                            '<td class="tr">' + fix0(list[i].curMiddleRepairCounts) + '</td>' +
                            '<td class="tr">' + fix0(list[i].curSmallRepairCounts) + '</td>' +
                            '<td class="tr">' + fix0(list[i].curToRepairCounts) + '</td>' +
                            '<td class="tr">' + fix2(list[i].curAvgRepairUsedMin) + '</td>' +
                            '<td class="tr">' + fix2(list[i].curAvgResponseMin) + '</td>' +
                            '<td class="tr">' + fix0(list[i].curFaultCounts) + '</td>' +
                            '<td class="tr">' + fix2(list[i].curIntactRatio) + '</td>' +
                            '<td class="tr">' + fix2(list[i].curOnceRepairRate) + '</td>' +
                            '<td class="tr">' + fix2(list[i].curUpkeepRate) + '</td>' +
                            '</tr>'
                        );
                    }
                }
            } else if (tag === 'halt') {
                theadStr = (
                    '<tr><th class="tc">#</th>' +
                    '<th class="sort tl" data-key="name">'+$.i18n.prop('share.table.head.sbmc')+'</th>' +
                    '<th class="sort tl" data-key="firstTypeName">'+$.i18n.prop('share.table.head.sblx')+'</th>' +
                    '<th class="sort tl" data-key="modalName">'+$.i18n.prop('share.table.head.sbxh')+'</th>' +
                    '<th class="sort tl" data-key="hospital">'+$.i18n.prop('share.assets.ssyy')+'</th>' +
                    '<th class="sort tl" data-key="department">'+$.i18n.prop('share.assets.ssks')+'</th>' +
                    '<th class="sort tl" data-key="sn">'+$.i18n.prop('share.assets.snbh')+'</th>' +
                    '<th class="sort tl" data-key="assetsNo">'+$.i18n.prop('share.assets.zcbh')+'</th>' +
                    '<th class="sort tl" data-key="manufacturer">'+$.i18n.prop('brand.overview.sbcj')+'</th>' +
                    '<th class="sort tl" data-key="fault">'+$.i18n.prop('maintian.record.gzms')+'</th>' +
                    '<th class="sort tl" data-key="repairContent">'+$.i18n.prop('maintian.record.wxzdms')+'</th>' +
                    '<th class="sort tl" data-key="repairSize">'+$.i18n.prop('maintian.record.wxdx')+'</th>' +
                    '<th class="sort tl" data-key="repairType">'+$.i18n.prop('maintian.record.wxfs')+'</th>' +
                    '<th class="sort tl" data-key="engineer">'+$.i18n.prop('maintian.record.gcs')+'</th>' +
                    '<th class="sort tl" data-key="enableDate">'+$.i18n.prop('share.assets.sbqyrq')+'</th>' +
                    '<th class="sort tl" data-key="qrcode">'+$.i18n.prop('maintian.record.ewm')+'</th>' +
                    '<th class="sort tr" data-key="price">'+$.i18n.prop('share.assets.sbje(wy)')+'</th>' +
                    '<th class="sort tr" data-key="depreciationPrice">'+$.i18n.prop('share.assets.zjje(wy)')+'</th>' +
                    '<th class="sort tr" data-key="estimateTotalCost">'+$.i18n.prop('maintian.assets.zwxfy(wy)')+'</th>' +
                    '<th class="sort tr" data-key="haltTime">'+$.i18n.prop('maintainer.assets.pjdjsj(fz)')+'</th>' +
                    '<th class="sort tr" data-key="repairUsedMin">'+$.i18n.prop('maintian.record.wxsj(fz)')+'</th>' +
                    '<th class="sort tr" data-key="responseMin">'+$.i18n.prop('maintian.record.xysj(fz)')+'</th>' +
                    '<th class="sort tr" data-key="visitCounts">'+$.i18n.prop('maintian.record.smcs')+'</th>' +
                    '<th class="sort tr" data-key="usedTime">'+$.i18n.prop('share.assets.ysysj(n)')+'</th>' +
                    '<th class="sort tr" data-key="ageLimitMeasure">'+$.i18n.prop('share.assets.nxzs')+'</th>' +
                    '</tr>'
                );
                tfootStr = (
                    '<tr>' +
                    '<td class="tc">'+$.i18n.prop('share.table.tail.zj')+'</td>' +
                    '<td class="tl">' + list.length + '</td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tl"></td>' +
                    '<td class="tr">' + fix2(list[-1].price / PRICE_CONVERT) + '</td>' +
                    '<td class="tr">' + fix2(list[-1].depreciationPrice / PRICE_CONVERT) + '</td>' +
                    '<td class="tr">' + fix2(list[-1].estimateTotalCost / PRICE_CONVERT) + '</td>' +
                    '<td class="tr">' + fix0(list[-1].haltTime / list.length) + '</td>' +
                    '<td class="tr">' + fix0(list[-1].repairUsedMin / list.length) + '</td>' +
                    '<td class="tr">' + fix2(list[-1].responseMin / list.length) + '</td>' +
                    '<td class="tr">' + fix2(list[-1].visitCounts / list.length) + '</td>' +
                    '<td class="tr">' + fix2(list[-1].usedTime / list.length) + '</td>' +
                    '<td class="tr">' + fix2(list[-1].ageLimitMeasure / list.length) + '</td>' +
                    '</tr>'
                );
                for (var i = 0; i < list.length; i++) {
                    tbodyStr += (
                        '<tr>' +
                        '<td class="tc">' + (i + 1) + '</td>' +
                        '<td class="spanTitle" onclick="$containerObj.query(\'assets\',\'' + list[i].id + '\')">' + fixStr(list[i].name) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].firstTypeName) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].modalName) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].hospital) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].department) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].sn) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].assetsNo) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].manufacturer) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].fault) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].repairContent) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].repairSize) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].repairType) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].engineer) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].enableDate) + '</td>' +
                        '<td class="tl">' + fixStr(list[i].qrcode) + '</td>' +
                        '<td class="tr">' + fix2(list[i].price / PRICE_CONVERT) + '</td>' +
                        '<td class="tr">' + fix2(list[i].depreciationPrice / PRICE_CONVERT) + '</td>' +
                        '<td class="tr">' + fix2(list[i].estimateTotalCost / PRICE_CONVERT) + '</td>' +
                        '<td class="tr">' + fix0(list[i].haltTime) + '</td>' +
                        '<td class="tr">' + fix0(list[i].repairUsedMin) + '</td>' +
                        '<td class="tr">' + fix0(list[i].responseMin) + '</td>' +
                        '<td class="tr">' + fix0(list[i].visitCounts) + '</td>' +
                        '<td class="tr">' + fix2(list[i].usedTime) + '</td>' +
                        '<td class="tr">' + fix2(list[i].ageLimitMeasure) + '</td>' +
                        '</tr>'
                    );
                }
            }

            $this.assetsThead.html(theadStr);
            $this.assetsTbody.html(tbodyStr);
            $this.assetsTfoot.html(tfootStr);
            /* 排序 */
            var sort = $this.assetsThead.find('.sort').append('<img src="' + basePath + 'plugins/charts/images/sort.png">').each(function () {
                if (key === $(this).data().key) {
                    $(this).find('img').attr('src', basePath + 'plugins/charts/images/sort_' + (sorting === 'desc' ? 'up' : 'down') + '.png');
                }
            });
            sort.on('click', function () {
                var src = $(this).find('img').attr('src');
                if (src.indexOf('sort_up.png') !== -1) {
                    $containerObj.modalObj.setAssetsTable($(this).data().key, 'asc', tag);
                } else if ((src.indexOf('sort_down.png') !== -1) || (src.indexOf('sort.png') !== -1)) {
                    $containerObj.modalObj.setAssetsTable($(this).data().key, 'desc', tag);
                }
            });
            $this.assetsMain.iziModal('open');
            setTimeout(function () {
                if (list.length > 200) {
                    $this.assetsTable.tableHeadFixer({'head': true, 'foot': true});
                } else {
                    $this.assetsTable.tableHeadFixer({'left': 2, 'head': true, 'foot': true});
                }
                loading(true);
            }, 20);
        }
    };
});